package com.hotelsystem.service.impl;

import com.hotelsystem.dao.LoggingMapper;
import com.hotelsystem.pojo.Logging;
import com.hotelsystem.pojo.vo.LoggingQueryVo;
import com.hotelsystem.service.LoggingService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;


@Service(value = "loggingServiceImpl")
public class LoggingServiceImpl implements LoggingService {

    @Resource
    private LoggingMapper loggingMapper;

    @Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
    @Override
    public List<Logging> getAllLoggingLists(LoggingQueryVo loggingQueryVo) throws Exception {
        return loggingMapper.getAllLoggingLists(loggingQueryVo);
    }

    @Override
    public Integer deleteLoggingInfo(Integer loggingId) throws Exception {
        return  loggingMapper.deleteLoggingInfoById(loggingId);
    }

    @Override
    public Integer insert(Logging logging) throws Exception {
        return loggingMapper.insert(logging);
    }

}
